package com.wideplay.warp.clustering.oscache;

import com.google.inject.Binder;
import com.google.inject.Singleton;
import com.wideplay.warp.clustering.DataGrid;
import com.wideplay.warp.clustering.DataGridService;

import java.lang.annotation.Annotation;

/**
 * Created with IntelliJ IDEA.
 * On: 23/06/2007
 *
 * @author Dhanji R. Prasanna
 * @since 1.0
 */
public class OsCacheBindingSupport {

    private OsCacheBindingSupport() {
    }

    public static void bindObjectCluster(Binder binder, Class<? extends Annotation> bindingAnn) {
        binder.bind(DataGrid.class).annotatedWith(bindingAnn).to(OsCacheDataGridImpl.class).in(Singleton.class);
    }

    public static void bindObjectCluster(Binder binder) {
        binder.bind(DataGrid.class).to(OsCacheDataGridImpl.class).in(Singleton.class);
    }

    public static void bindClusterService(Binder binder) {
        binder.bind(DataGridService.class).to(OsCacheDataGridService.class).in(Singleton.class);
    }
}
